<xmp type='template' name='form.text'>
    <jsouperFormUi id="{{__system.attrs.id}}" bind-class="{{class}}">
        {{#if label}}
        <label>{{label}}</label>
        {{/if}}
        <inputTextWrap class="{{#if disabled}} disabledMask{{/if}}{{#if __system.attrs.isFocus}} focusInput{{/if}}{{#if __system.attrs.isSubmitted&&__system.attrs.isSubmitted}} patternError{{/if}}">
            {{#layout 'form.text.placeholder','$This',placeholder&&(!value)}}
            <input type="text" class="jsouper-ui-input-text" value="{{value}}" accessKey="{{accessKey}}" alt="{{alt}}" defaultValue="{{defaultValue}}" disabled="{{disabled}}" id="{{id}}" maxLength="{{maxLength}}" name="{{name}}" readOnly="{{readOnly}}" size="{{size}}" tabIndex="{{tabIndex}}" autocomplete="{{#if __system.attrs.autocomplete}}on{{#else}}off{{/if}}" input="{{'value'}}">
            {{#layout 'form.text.autocomplete','autocomplete',__system.attrs.close_sys_ac&&value&&__system.attrs.isFocus}}
            <!-- 这边绑定pattern，因为pattern_error属性依赖于pattern内部的触发，所以需要绑定'pattern'而不是'$This'来进行一次主动地触发getter函数，从而生成依赖，否则就得手动运行一次getter -->
            {{#layout 'form.text.pattern','pattern',__system.attrs.pattern_error&&__system.attrs.isFocus&&__system.attrs.isSubmitted}}
        </inputTextWrap>
    </jsouperFormUi>
</xmp>
<xmp type='template' name='form.text.placeholder'>
    <placeholder>{{placeholder}}</placeholder>
</xmp>
<xmp type='template' name='form.text.autocomplete'>
    <autocomplete>
        <autocompleteWrap>
            {{#each $This}}
            <autocompleteItem event-mousedown="{{'$PARENT.$PARENT.__system.events.autocomplete.click'}}">{{$This}}</autocompleteItem>
            {{/each}}
        </autocompleteWrap>
    </autocomplete>
</xmp>
<xmp type='template' name='form.text.pattern'>
    <pattern>
        <patternWrap event-mousedown="{{'$PARENT.__system.events.click.pattern'}}">
            <patternHead>
                <patternArrow>◇</patternArrow>
                <patternArrowMark>◆</patternArrowMark>
                <patternIcon>!</patternIcon>
                <patternTitle>请与所请求的格式保持一致。</patternTitle>
            </patternHead>
            <patternContent>
                {{$This}}
            </patternContent>
        </patternWrap>
    </pattern>
</xmp>
